<?php

declare(strict_types=1);

/**
 * @Author:     Frank
 * @contact     frank_hhm@163.com
 * @Date:       2022-11-15 16:05:58
 * @Last Modified time: 2022-11-16 15:02:23
 */
namespace app\common\dao\system;

use app\common\model\system\ConfigModel;
use frank\base\BaseDao;
/**
 * 配置项分类
 * Class ConfigDao
 * @package app\common\dao\system
 */
class ConfigDao extends BaseDao
{
    /**
     * 设置模型
     */
    protected function setModel(): string
    {
        return ConfigModel::class;
    }

    /**
     * 配置项列表
     */
    public function getConfigList(array $where, int $page, int $limit)
    {
        return $this->search($where)->order('sort desc,id desc')->page($page)->paginate($limit)->toArray();
    }

    public function getConfigSelect(array $where){
        return $this->search($where)->order('sort desc,id desc')->select()->toArray();
    } 
}
